package myLesson3;

import java.util.Scanner;

public class Diagn {

	public static void main(String[] args) {

		int n = 4;
		int[][] a = new int[n][n];
		int counter = 1;

		for (int d = 0; d < n; d++) {
			for (int i = d; i < n; i++) {
				a[i][i - d] = counter;
				counter++;
			}
		}
		for (int d = 1; d < n; d++) {
			for (int i = 0; i <= n - 1 - d; i++) {
				a[i][i + d] = counter;
				counter++;
			}
		}
		for (int row = 0; row < a.length; row++) {
			for (int col = 0; col < a[row].length; col++) {
				System.out.print(a[row][col] + "  ");

			}

			System.out.println();
		}
	}

}
